package com.example.helloandroid;

import com.example.helloandroid.R;

import android.app.Activity;
import android.os.Bundle;
import android.view.MenuItem;
import android.view.View;
import android.widget.PopupMenu;
import android.widget.TextView;
import android.widget.Toast;


public class HelloAndroid extends Activity {
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
    }
    
    public void onPopupButtonClick(View button) {
        PopupMenu popup = new PopupMenu(this, button);
        popup.getMenuInflater().inflate(R.menu.popup, popup.getMenu());

        popup.setOnMenuItemClickListener(new PopupMenu.OnMenuItemClickListener() {
            public boolean onMenuItemClick(MenuItem item) {
                Toast.makeText(HelloAndroid.this, "Clicked popup menu item " + item.getTitle(),
                        Toast.LENGTH_SHORT).show();
                return true;
            }
        });

        popup.show();
    }
    
    public void Initialization()
    {
    	Item i1 = new Item("burger",4.0, "best when hot");
    	Item i2 = new Item("coke",1.0, "best when cold");
    	Item i3 = new Item("desert",2.0, "best when sucre");
    	ItemList list = new ItemList();
    	list.AddItem(i1);
    	list.AddItem(i2);
    	list.AddItem(i3);
    	
    }
}